package com.meitianhui.convenitenbuy.module.wallet.http;

import com.meitianhui.convenitenbuy.base.BaseArrayResponse;
import com.meitianhui.convenitenbuy.base.BaseListResponse;
import com.meitianhui.convenitenbuy.base.BaseResponse;
import com.meitianhui.convenitenbuy.module.order.model.bean.EmptyInfo;
import com.meitianhui.convenitenbuy.module.wallet.model.CardRecordBean;
import com.meitianhui.convenitenbuy.module.wallet.model.CodeFlowBean;
import com.meitianhui.convenitenbuy.module.wallet.model.CouponBean;
import com.meitianhui.convenitenbuy.module.wallet.model.CouponDetailBean;
import com.meitianhui.convenitenbuy.module.wallet.model.FamilyCard;
import com.meitianhui.convenitenbuy.module.wallet.model.PaymentCodeBean;
import com.meitianhui.convenitenbuy.module.wallet.model.PropertyBean;
import com.meitianhui.convenitenbuy.module.wallet.model.RechargeBackInfoBean;
import com.meitianhui.convenitenbuy.module.wallet.model.RedPacketBean;
import com.meitianhui.convenitenbuy.module.wallet.model.StoreInfoBean;
import com.meitianhui.convenitenbuy.module.wallet.model.TempCard;
import com.meitianhui.convenitenbuy.module.wallet.model.TradeRecordBean;
import com.meitianhui.convenitenbuy.module.wallet.model.UsableChangeBean;
import com.meitianhui.convenitenbuy.module.wallet.model.UserPropertyBean;

import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by Administrator on 2017/11/1.
 */

public interface WalletApi {
    /**
     * 获取用户权益等资产
     *
     * @param userToken
     * @return
     */
    @POST("statistic/consumer/card_coupon?")
    Observable<BaseResponse<UserPropertyBean>> getUserProperty(@Query("user_token") String userToken);

    /**
     * 获取用户交易明细
     *
     * @param appToken
     * @param service    finance.memberCashLogPageFind
     * @param jsonPage   每页显示的数量 page_no page_size
     * @param paramsJson member_id member_type_key
     * @return
     */
    @POST("finance?")
    Observable<BaseListResponse<TradeRecordBean>> getTradeDetail(@Query("app_token") String appToken, @Query("service") String service, @Query("page") String jsonPage, @Query("params") String paramsJson);

    /**
     * 获取用户金币明细
     *
     * @param appToken
     * @param service    finance.memberGoldLogPageFind
     * @param jsonPage   每页显示的数量 page_no page_size
     * @param paramsJson member_id member_type_key
     * @return
     */
    @POST("finance?")
    Observable<BaseListResponse<PropertyBean>> getGoldDetail(@Query("app_token") String appToken, @Query("service") String service, @Query("page") String jsonPage, @Query("params") String paramsJson);

    /**
     * 获取用户二维码中安全码
     *
     * @param userToken
     * @param service    trade.tradeCodeRegister
     * @param jsonParams member_id member_type_key T
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<PaymentCodeBean>> getSecurityCode(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取用户可用余额
     *
     * @param userToken
     * @param service    finance.usableCashBalanceFind
     * @param jsonParams member_id member_type_key
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<UsableChangeBean>> getUsableChange(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 比较用户输入的支付密码
     *
     * @param userToken
     * @param password  用户输入的密码
     * @return
     */
    @POST("user/verify_pay_pwd?")
    Observable<BaseResponse<EmptyInfo>> comparePassword(@Query("user_token") String userToken, @Query("payment_password") String password);

    /**
     * 获取用户设置金额的二维码字符串
     *
     * @param userToken
     * @return
     */
    @POST("trade/reg?")
    Observable<BaseResponse<CodeFlowBean>> getPaymentCode(@Query("app_token") String userToken);

    /**
     * 生成充值支付订单
     *
     * @param userToken
     * @param service    finance.balanceRecharge
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<RechargeBackInfoBean>> getRechargeOrder(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取用户红包
     *
     * @param userToken
     * @param service    goods.gcActivityDetailListForConsumerPageFind
     * @param jsonPage
     * @param jsonParams
     * @return
     */
    @POST("goods?")
    Observable<BaseListResponse<RedPacketBean>> getRedPackets(@Query("user_token") String userToken, @Query("service") String service, @Query("page") String jsonPage, @Query("params") String jsonParams);

    /**
     * 获取用户红包详情
     *
     * @param userToken
     * @param service    goods.gcActivityDetailListForConsumerPageFind
     * @param jsonParams
     * @return
     */
    @POST("goods?")
    Observable<BaseListResponse<Object>> openRedPacket(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取用户优惠券
     *
     * @param userToken
     * @param service    finance.memberCouponFind
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<CouponBean>> getCoupons(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 确认二维码扫描订单结果
     *
     * @param appToken
     * @param flowNo       订单流水号
     * @param securityCode
     * @return
     */
    @POST("trade/verify?")
    Observable<BaseListResponse<EmptyInfo>> verifyCode(@Query("app_token") String appToken, @Query("flow_no") String flowNo, @Query("security_code") String securityCode);

    /**
     * 根据ID获取门店详情
     *
     * @param appToken
     * @param service    member.storeDetailForConsumerFind
     * @param jsonParams
     * @return
     */
    @POST("member?")
    Observable<BaseResponse<StoreInfoBean>> getStore(@Query("app_token") String appToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 钱包支付
     *
     * @param userToken
     * @param service    finance.balancePay
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<EmptyInfo>> payForOrder(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 二维码收款
     *
     * @param userToken
     * @param service    finance.balancePay
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<EmptyInfo>> receivePay(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取用户亲情卡或者验证用户扫描的亲情卡
     *
     * @param userToken
     * @param service    finance.consumerPrepayCardFind
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseArrayResponse<FamilyCard>> getFamilyCards(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取用户新增亲情卡码
     *
     * @param appToken
     * @param service    finance.consumerTempPrepayCardCardNoGet
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<TempCard>> getTempCardCode(@Query("app_token") String appToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 新增虚拟卡
     *
     * @param appToken
     * @param service    finance.consumerTempPrepayCardCreate
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse> addTempCard(@Query("app_token") String appToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 新增实体卡
     *
     * @param userToken
     * @param service    finance.consumerPrepayCardEdit
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<EmptyInfo>> addCard(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 销毁亲情卡
     *
     * @param userToken
     * @param service    finance.consumerPrepayCardUnBind
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<EmptyInfo>> unBind(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获取亲情卡消费明细
     *
     * @param userToken
     * @param service    finance.transPrepayCardPageFind
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseListResponse<CardRecordBean>> getCardRecord(@Query("user_token") String userToken, @Query("service") String service, @Query("page") String jsonPage, @Query("params") String jsonParams);

    /**
     * 更改亲情卡备注
     *
     * @param userToken
     * @param service    finance.consumerPrepayCardEdit
     * @param jsonParams
     * @return
     */
    @POST("finance?")
    Observable<BaseResponse<EmptyInfo>> modifyCardRemark(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

    /**
     * 获得优惠券详情
     *
     * @param userToken
     * @param service    goods.couponDetailFind
     * @param jsonParams
     * @return
     */
    @POST("goods?")
    Observable<BaseResponse<CouponDetailBean>> getCouponDetail(@Query("user_token") String userToken, @Query("service") String service, @Query("params") String jsonParams);

}
